# @Version        : 1.0
# @Update Time    : 2025/10/23 22:42
# @File           : fastapi_guard_test.py
# @IDE            : PyCharm
# @Desc           : 文件描述信息

from fastapi import FastAPI
from guard.middleware import SecurityMiddleware
from guard.models import SecurityConfig
from guard.handlers.ipinfo_handler import IPInfoManager

app = FastAPI()

config = SecurityConfig(
    geo_ip_handler=IPInfoManager("your_token_here"), enable_redis=False, rate_limit=100, auto_ban_threshold=5
)

app.add_middleware(SecurityMiddleware, config=config)
